package com.mlf.observer.spring;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

// 3. 创建监听器 (注解方式)
// 积分服务监听器
@Component
public class PointsServiceListener {

    @EventListener
    public void onUserRegisteredEvent(UserRegisteredEvent event) {
        System.out.println("用户" + event.getUsername() + "注册成功，增加注册积分");
        // 调用积分服务
    }
}
